package edu.lingnan.timer;

import edu.lingnan.annotation.Log;
import edu.lingnan.mapper.LogMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @ClassName logTimer
 * @Description TODO
 * @Author kang
 * @Date 2022/9/14 下午 9:25
 * @Version 1.0
 */
@Component
@Slf4j
public class LogTimer {

    @Autowired
    private LogMapper logMapper;

    @Scheduled(cron = "0 0 0 ? 6 ? ")
    public void run(){
        log.info("我执行了一次");
        logMapper.deleteAll();
    }
}
